import { get, post, del, put } from '@/api'

const api = {
  ADD_WAREHOUSE: '/api/addWarehouse', // 添加仓库信息
  DEL_WAREHOUSE: '/api/delWarehouse', // 删除仓库
  UPDATE_WAREHOUSE: '/api/editWarehouse', // 修改仓库信息
  ALL_WAREHOUSE: '/api/findAllWarehouse', // 分页查询所有仓库
  FIND_WAREHOUSE: '/api/findWarehouse', // 按条件模糊查询

  ADD_SUPPLY: '/api/add', // 新增供应商
  DEL_SUPPLY: '/api/delete', // 删除供应商
  UPDATE_SUPPLY: '/api/edit', // 修改供应商信息
  ALL_SUPPLY: '/api/selectAll', // 查询所有供应商
  FIND_SUPPLY: '/api/findSupply', // 按条件模糊查询

  ADD_CUSTOMER: '/api/addCustomers', // 新增客户信息
  DEL_CUSTOMER: '/api/delCustomer', // 删除客户信息
  UPDATE_CUSTOMER: '/api/editCustomer', // 修改客户信息
  ALL_CUSTOMER: '/api/findAllCustomers', // 分页查询所有客户信息
  FIND_CUSTOMER: '/api/findCustomer', // 按条件模糊查询

  ADD_PRO_TYPE: '/api/addProType', // 新增产品类别
  DEL_PRO_TYPE: '/api/delProType', // 删除产品类别
  UPDATE_PRO_TYPE: '/api/editProType', // 修改产品类别
  ALL_PRO_TYPE: '/api/findAllProType', // 分页查询所有产品类别
  FIND_PRO_TYPE: '/api/findProType' // 按条件模糊查询产品类别
}

export const addWarehouse = data => post(api.ADD_WAREHOUSE, data)
export const delWarehouse = params => del(api.DEL_WAREHOUSE, params)
export const updateWarehouse = data => post(api.UPDATE_WAREHOUSE, data)
export const allWarehouse = params => get(api.ALL_WAREHOUSE, params)
export const findWarehouse = data => post(api.FIND_WAREHOUSE, data)

export const addSupply = data => post(api.ADD_SUPPLY, data)
export const delSupply = params => del(api.DEL_SUPPLY, params)
export const updateSupply = data => put(api.UPDATE_SUPPLY, data)
export const allSupply = params => get(api.ALL_SUPPLY, params)
export const findSupply = data => put(api.FIND_SUPPLY, data)

export const addCustomer = data => post(api.ADD_CUSTOMER, data)
export const delCustomer = params => del(api.DEL_CUSTOMER, params)
export const updateCustomer = data => put(api.UPDATE_CUSTOMER, data)
export const allCustomer = params => get(api.ALL_CUSTOMER, params)
export const findCustomer = data => post(api.FIND_CUSTOMER, data)

export const addProType = data => post(api.ADD_PRO_TYPE, data)
export const delProType = params => del(api.DEL_PRO_TYPE, params)
export const updateProType = data => post(api.UPDATE_PRO_TYPE, data)
export const allProType = params => get(api.ALL_PRO_TYPE, params)
export const findProType = data => post(api.FIND_PRO_TYPE, data)
